import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/main/login/index.js')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/main/register/index.js')
  },
  {
    name: '404',
    path: '/404',
    redirect: '',
    // component: loadComponent('views/404.vue'),
    component: () => import("@/views/404.vue"),
    chunkName: 'views/404'
  }, {
    path: '*',
    // component: loadComponent('views/404.vue'),
    component: () => import("@/views/404.vue"),
    hidden: true
  },
  {
    name: 'index',
    path: '/',
    component: () => import(/* webpackChunkName: "indexpage" */ "@/views/index.vue")
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
